package com.wanxi.servlet.stores;//package com.wanxi.servlet.stores;
//
//import com.alibaba.fastjson2.JSONObject;
//import com.wanxi.model.CompanyModel;
//import com.wanxi.model.ResultModel;
//import com.wanxi.model.StoresModel;
//import com.wanxi.service.CompanyService;
//import com.wanxi.service.StoresService;
//import com.wanxi.service.impl.CompanyServiceImpl;
//import com.wanxi.service.impl.StoresServiceImpl;
//import com.wanxi.util.Tool;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
//@WebServlet("/back/stores/update")
//public class StoresUpdateServlet extends HttpServlet {
//    @Override
//    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        //        1.乱码处理
////        req.setCharacterEncoding("UTF-8");
////        resp.setCharacterEncoding("UTF-8");
////        2.得到前端的值
//        String address = req.getParameter("address");
//        String isShow = req.getParameter("isShow");
//        String img = req.getParameter("img");
//        String id = req.getParameter("id");
//
////        3.封装到model
//        StoresModel storesModel = new StoresModel();
//        storesModel.setIsShow(Tool.strToInt(isShow));
//        storesModel.setId(Tool.strToInt(id));
//        storesModel.setImg(Tool.nullToStr(img));
//        storesModel.setAddress(Tool.nullToStr(address));
////        4.调用service
//        StoresService storesService = new StoresServiceImpl();
////        5.调用service的方法并得到返回值
//        ResultModel resultModel = storesService.update(storesModel);
//
////        6.返回前端
//        resp.getWriter().println(JSONObject.toJSONString(resultModel));
//    }
//}
